package com.wmh.baseservice.user.service;

import com.wmh.baseservice.merchant.pojo.MerchantGroupGoods;
import com.wmh.baseservice.skd.pojo.SkdGoodsSpec;
import com.wmh.baseservice.user.pojo.UsGroupGoodsOrder;
import com.wmh.baseservice.common.mybatisplus.methods.CommonService;
import com.wmh.baseservice.user.pojo.UsInfo;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author wmh generator
 * @since 2022-03-07
 */
public interface UsGroupGoodsOrderService extends CommonService<UsGroupGoodsOrder> {

    /**
     *用户端-拼团成员列表
     */
    List<UsGroupGoodsOrder> spellGroupList(Long id);


    /**
     * 开团-有规格
     */
    void openGroup(UsGroupGoodsOrder usGroupGoodsOrder,MerchantGroupGoods merchantGroupGoods, SkdGoodsSpec skdGoodsSpec);

    /**
     * 参团用户列表-(确认订单、订单详情用)
     */
    List<UsGroupGoodsOrder> usList(Long teamId);

    /**
     * 余额支付
     */
    void balancePay(UsGroupGoodsOrder usGroupGoodsOrder, BigDecimal payAmount, UsInfo usInfo);

    /**
     * 取消订单
     */
    void cancelOrder(Long value);

    /**
     * 确认收货
     */
    void theGoods(UsGroupGoodsOrder usGroupGoodsOrder);

    /**
     * 当天订单总重量/总数量
     * @param map
     */
    int totalCount(Map<String, Object> map);

    /**
     * 拼单商品提交订单
     */
    void openOrJoinGroup(MerchantGroupGoods merchantGroupGoods, SkdGoodsSpec skdGoodsSpec, UsGroupGoodsOrder usGroupGoodsOrder);


    /**
     * 查询当前可结算的团购订单
     */
    List<UsGroupGoodsOrder> settlementOrderList(Long id);

    /**
     * 微信支付
     */
    void weChatPay(String orderNum);

    /**
     * 查出当前拼团的用户
     */
    List<Long> thyDayUsAvatar(Long id, Integer batchNum);

    /**
     * 发货
     */
    void delivery(UsGroupGoodsOrder usGroupGoodsOrder);

    /**
     * 查询所有已完成交易且大于售后期的订单的推广佣金
     */
    List<UsGroupGoodsOrder> getSettleTheCommissionOrderList(String value);

    /**
     * 查询所有可结算商家收益的订单
     * @param day 收货到系统强制完成订单间隔天数
     * @return 订单列表
     * */
    List<UsGroupGoodsOrder> getCanSettleEarningsOrderList(String day);

    /**
     * 自动收货
     */
    List<UsGroupGoodsOrder> autoDeliver(String value);

    /**
     * 商家当月团购订单总交易金额
     */
    BigDecimal promoteCommission(List<Long> merchantIds);

    /**
     * 查询用户30秒内是否有提交订单
     */
    int queryShortOrder(Long usId);

    List<UsGroupGoodsOrder> getFilteredOrders(Long usId, Integer type, String keyword);

    int getLeaderTotalOrderNumByGroupNoList(List<Long> groupNoList);
}
